package com.burgeon.backend.SHOPBACKEND.controller;

import com.burgeon.backend.SHOPBACKEND.service.GoodsBannerService;
import com.burgeon.backend.stsutil.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@CrossOrigin
@RestController
@RequestMapping("shopbackent/banner")
public class GoodsBannerController extends BaseController{

    @Autowired
    private GoodsBannerService goodsBannerService;

    //上传banner
    @RequestMapping("img")
    public ResponseResult<Void> BannerImg
            (@RequestParam(value = "files") MultipartFile files, String id, String account,String token) {

        goodsBannerService.addGoodsBanner(files, account, id,token);
        return new ResponseResult<>(SUCCESS);
    }

}
